import React from 'react';
import './style/index.less';

import {Cascader} from 'antd';
import $$ from "utils";


const options = [{
  value: 'zhejiang',
  label: 'Zhejiang',
  children: [{
    value: 'hangzhou',
    label: 'Hangzhou',
    children: [{
      value: 'xihu',
      label: 'West Lake',
    }],
  }],
}, {
  value: 'jiangsu',
  label: 'Jiangsu',
  children: [{
    value: 'nanjing',
    label: 'Nanjing',
    children: [{
      value: 'zhonghuamen',
      label: 'Zhong Hua Men',
    }],
  }],
}];

// 返回的是数组
function onChange(value) {
  $$.debug(value);
}

export default class CascaderDemo extends React.Component {
  render() {
    return (
      <div>
        <Cascader style={{width: 300}} options={options} onChange={onChange} placeholder="Please select"/>,
      </div>
    );
  }
}
